// ignore_for_file: avoid_print, prefer_typing_uninitialized_variables

import '../request/base_request.dart';
import 'dio_adapter.dart';
import 'hi_adapter.dart';


class HiNet {
  HiNet._();
  static final HiNet _instance = HiNet._();
  static HiNet getInstance() {
    return _instance;
  }

  Future fire(BaseRequest request) async {
    HiNetResponse? response;
    var error;
    
    response = await send(request);
    

    if (response == null) {
      printLog(error);
    }

    var result = response?.data;
    return result;
    
  }

  Future<dynamic> send<T>(BaseRequest request) async {
    DioAdapter adapter = DioAdapter();
    return adapter.send(request);
  }

  void printLog(log) {
    print('hi_net: ${log.toString()}');
  }
}
